cmake_minimum_required(VERSION 3.27.0)

project("Diploma" VERSION 1.0 LANGUAGES CXX)

find_package(GTest REQUIRED)

set (CMAKE_CXX_STANDARD 20)

include_directories(
        ${GTEST_INCLUDE_DIRS}
)

add_compile_options(
    -Werror

    -Wall
    -Wextra
    -Wpedantic

    -Wcast-align
    -Wcast-qual
    -Wconversion
    -Wctor-dtor-privacy
    -Wenum-compare
    -Wfloat-equal
    -Wnon-virtual-dtor
    -Wold-style-cast
    -Woverloaded-virtual
    -Wredundant-decls
    -Wsign-conversion
    -Wsign-promo

    -lgtest

    -O3

    --coverage
)

add_link_options(
    -leggx 
    -lX11 
    -lm
    )

set(SOURCE_FILES
        src/Image.cpp
        src/Cell.cpp
        src/Surface.cpp
        src/Climate.cpp
        src/Control.cpp
        src/main.cpp
        TestDiploma.cpp
)


if(NOT CMAKE_CXX_EXTENSIONS)
    set(CMAKE_CXX_EXTENSIONS OFF)
endif()

add_executable( Diploma
  ${SOURCE_FILES}
  )
enable_testing()
target_link_libraries(Diploma eggx ${GTEST_LIBRARIES})
add_test(TARGET Diploma
        TEST_SUFFIX .noArgs
        SOURCES TestDiploma.cpp)
